#!/usr/bin/env python
# encoding: utf-8
"""
@author: youfeng
@email: youfeng243@163.com
@license: Apache Licence
@file: headless_demo.py
@time: 2017/12/28 11:39
"""

from selenium import webdriver

chrome_options = webdriver.ChromeOptions()
chrome_options.add_argument('--headless')
# chrome_options.add_argument('--disable-gpu')

chrome_options.binary_location = '/Applications/Google Chrome.app/Contents/MacOS/Google Chrome'
# chrome_options.binary_location = '/opt/google/chrome/chrome'

driver = webdriver.Chrome(executable_path='/Applications/Google Chrome.app/Contents/MacOS/Google Chrome',
                          chrome_options=chrome_options)
# executable_path=os.path.abspath("google-chrome"))
driver.get("http://www.duo.com")
# from selenium import webdriver
# from xvfbwrapper import Xvfb
#
# xvfb = Xvfb(width=1280, height=720)
# xvfb.start()
# driver = webdriver.Chrome()
# driver.get('http://demo.testfire.net')
# cookies = driver.get_cookies()
# print cookies
# driver.close()
# xvfb.stop()
